package com.globallogic.vkulyk.SSHTool;

import org.junit.*;
import java.io.*;

public class E2E_UserDataMode_GetFile extends SSHToolTester {

	@Before
	public void setup() {
		setVarsFromPropertiesFile("testData/testing.properties");
	}

	@Test
	public void shouldGetFile() {
		setVarsFromPropertiesFile("testData/testing.properties");
		String fileName = new File(srcFileForGet).getName();
		String dstFile = dstDirForGet + "/" + fileName; 
		new File(dstFile).delete();
		
		String[] args = { user + ":" + password + "@" + host + ":" + port,
				"-get", srcFileForGet, dstDirForGet };

		new CLIHandler().run(args);

		Assert.assertTrue("File is not found locally.", new File(dstFile).exists());
	}

}